<!DOCTYPE html>
<html>
#{include file="header.html"}#
<body class="gray-bg">
<div class="ibox-content">
  <form class="form-horizontal" method="post" enctype="multipart/form-data" action="#{$smarty.const.ACT}#/crm/CstCustomerImport/cst_customer_import_show/">
    <input type="hidden" name="x" value="1">
    <div class="form-group">
      <label class="col-sm-2 control-label">导入文件</label>
      <div class="col-sm-10">
        <input type="file" class="form-control" name="filename">
		  <span class="help-block m-b-none">导入文件模板，通过导出数据文件作为模板数据格式</span>
      </div>
    </div>
    <div class="form-group">
      <div class="col-sm-offset-2 col-sm-8">
        <button class="btn btn-w-m btn-info" type="submit">确认导出数据</button>
      </div>
    </div>
  </form>
</div>
<!-- 自定义js --> 
<script src="#{$smarty.const.APP}#/View/template/js/content.js?v=1.0.0"></script> 
<script>
$(document).ready(function () {
	$(".datepicker").datepicker({
		language: "zh-CN",
		autoclose: true,//选中之后自动隐藏日期选择框
		clearBtn: true,//清除按钮
		todayBtn: true,//今日按钮
		format: "yyyy-mm-dd",
	});
	$(".datetimepicker").datetimepicker({
		language: "zh-CN",
		autoclose: true,//选中之后自动隐藏日期选择框
		clearBtn: true,//清除按钮
		todayBtn: true,//今日按钮
		format: "yyyy-mm-dd hh:ii:ss",
	});
	$('.i-checks').iCheck({
		checkboxClass: 'icheckbox_square-green',
		radioClass: 'iradio_square-green',
	});	
	//下拉选择+联动效果
	$('.chosen-select').chosen({search_contains: true});
	$(".customer-chosen-select").val("#{$customer_id}#").trigger("chosen:updated");

	//数据保存
	$("body").on("click", ".save-form", function() {
		FormData=$("form").serialize();
		$.ajax({
			type: "POST",
			url: "#{$smarty.const.ACT}#/crm/CstCustomerExport/cst_customer_export_cvs/",
			data:FormData,
			dataType:"json",
			success: function(data){
				if(data.statusCode=='200'){
					layer.msg('操作成功', {icon: 1}); 		
				}
			},    
			complete: function() {   
				setTimeout(function(){
					//关闭窗口
					var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
					parent.layer.close(index);
				 },800);
   		  },
		});		
	});
});
</script>
</body>
</html>